package sg.edu.nus.iss.club.gui;
import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JPanel;
import javax.swing.WindowConstants;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class ClubWindow extends javax.swing.JFrame {
	
	private JPanel contentPane;
	private MemberPanel memberPanel;
	private FacilityPanel facilityPanel;
	private BookingPanel bookingPanel;
	public ClubApplication clubApplication;

	public ClubWindow() {
		super();
	}
	
	public MemberPanel getMemberPanel() {
		return memberPanel;
	}
	
	public FacilityPanel getFacilityPanel() {
		return facilityPanel;
	}
	
	public BookingPanel getBookingPanel() {
		return bookingPanel;
	}
	
	public void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				contentPane = new JPanel();
				getContentPane().add(contentPane, BorderLayout.CENTER);
				contentPane.setLayout(new GridLayout(0,1,0,0));
				memberPanel = new MemberPanel();
				memberPanel.clubApplication = clubApplication;
				contentPane.add(memberPanel);
				facilityPanel = new FacilityPanel();
				facilityPanel.clubApplication = clubApplication;
				contentPane.add(facilityPanel);
				bookingPanel = new BookingPanel();
				bookingPanel.clubApplication = clubApplication;
				contentPane.add(bookingPanel);
			}
			pack();
			setSize(785, 711);
			setTitle("Club Management System");
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public void refresh() {
		bookingPanel.refresh();
		memberPanel.refresh();
		facilityPanel.refresh();
	}

}
